
using ServicesLib.TokenService;
using VaccinationCalendarAPI.Extensions;

var builder = WebApplication.CreateBuilder(args);
ConfigurationManager configuration = builder.Configuration;

builder.Services.CongigureContext(configuration);

builder.Services.ConfigureIdentity();

builder.Services.ConfigureAuthentication(configuration);

builder.Services.ConfigureSwagger();

builder.Services.AddScoped<ITokenService, TokenService>();

builder.Services.AddControllers();

builder.Services.AddControllers();

builder.WebHost.UseUrls("https://localhost:5000");

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();

// Authentication & Authorization
app.UseAuthentication();
app.UseAuthorization();

app.MapControllers();

app.Run();
